package com.wdcloud.framework_business.utils;

import com.orhanobut.logger.AndroidLogAdapter;
import com.orhanobut.logger.FormatStrategy;
import com.orhanobut.logger.Logger;
import com.orhanobut.logger.PrettyFormatStrategy;
import com.wdcloud.framework_business.BuildConfig;


/**
 * Info:
 * Created by Umbrella.
 * CreateTime: 2021/3/8 11:43
 */
public class LogUtil{
    public static void initLog(String LogTag)
    {
        FormatStrategy formatStrategy = PrettyFormatStrategy.newBuilder()
                .tag(LogTag)
                .build();
            Logger.addLogAdapter(new AndroidLogAdapter(formatStrategy){
                @Override
                public boolean isLoggable(int priority, String tag) {
                    return BuildConfig.DEBUG;
                }
            });
    }
    public static void d(Object object)
    {
        Logger.d(object);
    }
    public static void e(String msg)
    {
        Logger.e(msg);
    }
    public static void i(String msg)
    {
        Logger.i(msg);
    }
    public static void json(String strJson)
    {
        Logger.json(strJson);
    }
    public static void xml(String strXml)
    {
        Logger.xml(strXml);
    }
}